package com.example.demo.exception;

import com.example.demo.response.RspCodeInfoEnum;
import lombok.Getter;

public class TheCustomException extends RuntimeException  {
    public TheCustomException(RspCodeInfoEnum rspCodeInfoEnum){
        this.rspCodeInfoEnum = rspCodeInfoEnum;
    }
    @Getter
    private RspCodeInfoEnum rspCodeInfoEnum;
    //生成错误信息
    public static RspCodeInfoEnum generateError(RspCodeInfoEnum rspCodeInfoEnum) {
        throw new TheCustomException(rspCodeInfoEnum);
    }
}
